package com.cn.gmall.item.controller;

import com.cn.gmall.common.result.Result;
import com.cn.gmall.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.Map;

@RestController
@RequestMapping("/api/item")
//@SuppressWarnings("all")
public class ItemApiController {

    @Autowired
    ItemService itemService;

    /**
     * /api/item/{skuId}
     * 详情接口
     * @param skuId
     * @return
     */
    @GetMapping("/{skuId}")
    public Result getSkuById(@PathVariable Long skuId){
   Map<String,Object> map= itemService.getSkuById(skuId);

        return  Result.ok(map);
    }



}
